import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "*",
      redirect: "/404"
    },
    {
      path:'/404',
      name:'Name',
      component: resolve => require(['../components/404.vue'], resolve)
    },
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path:'/register',
      name:'Register',
      component:resolve => require(['../components/register.vue'], resolve)
    },
    {
      path: '/401',
      name: 'error401',
      component: resolve => require(['../components/error/401.vue'], resolve)
    },
    {
      path:'/user',
      name:'User',
      component:resolve => require(['../components/userInfo.vue'], resolve)
    },
    {
      path:'/findPwd',
      name:'FindPwd',
      component:resolve => require(['../components/forget.vue'], resolve)
    }
  ]
})
